<div class="form__wrapper">
  <div class="card pt-4">
    <div class="card-section debate-fields">
       <div class="row column">
        <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
      </div>

       <div class="row column">
        <%= form.translated :editor, :description, resource_mentionable: true, aria: { label: :description } %>
      </div>

      <div class="row column">
        <%= form.translated :editor, :instructions, aria: { label: :instructions } %>
      </div>

      <div class="row column">
        <%= form.translated :editor, :information_updates, aria: { label: :information_updates } %>
      </div>

      <div class="row column">
        <%= label_tag :debate_type, t(".debate_type") %>
        <div>
          <%= form.collection_radio_buttons(:finite, [[t(".finite"), true], [t(".open"), false]], :last, :first) do |builder|
            builder.label(class: "form__wrapper-checkbox-label") { builder.radio_button + builder.text } end %>
        </div>
      </div>

      <div class="row column debate-fields--finite">
        <div class="column">
          <%= form.datetime_field :start_time %>
        </div>
        <div class="column">
          <%= form.datetime_field :end_time %>
        </div>
      </div>

      <% if @form.taxonomy_filters&.any? %>
          <% @form.taxonomy_filters.each do |filter| %>
            <div class="row column">
              <%= filter_taxonomy_items_select_field form, :taxonomies, filter %>
            </div>
          <% end %>
      <% end %>

      <div class="row column">
        <%= form.check_box :comments_enabled, label: t("enabled", scope: "decidim.comments.admin.shared.availability_fields") %>
      </div>

      <div class="row column">
        <%= label_tag :comments_layout, t(".comments_visualization") %>
        <span class="help-text"><%= t(".comments_warning") %></span>
        <div>
          <%= form.collection_radio_buttons(:comments_layout, [[t(".single_column"), "single_column"], [t(".two_columns"), "two_columns"]], :last, :first) do |builder|
            builder.label(class: "form__wrapper-checkbox-label") { builder.radio_button + builder.text }
          end %>
        </div>
      </div>

      <% if component_settings.attachments_allowed? %>
        <div class="row column">
          <%= form.attachment :documents,
                              multiple: true,
                              label: t("decidim.debates.admin.debates.form.add_attachments"),
                              button_label: t("decidim.debates.admin.debates.form.add_attachments"),
                              button_edit_label: t("decidim.debates.admin.debates.form.edit_attachments"),
                              button_class: "button button__sm button__transparent-secondary",
                              help_i18n_scope: "decidim.forms.file_help.file",
                              help_text: t("decidim.debates.admin.debates.form.attachment_legend") %>
        </div>
      <% end %>
    </div>
  </div>
</div>

<%= append_javascript_pack_tag "decidim_debates_admin" %>
